import classNames from 'classnames'
import Icon from '../../../../components/Icon/index'
import styles from './index.module.scss'
import Image from '../../../../components/Image'
const ArticleItem = ({ article }) => {
  const {
    cover: { type, images },
    title,
  } = article
  // const type = 3
  // console.log(article)
  // const images = []

  return (
    <div className={styles.root}>
      <div
        className={classNames('article-content', {
          t3: type === 3,
          'none-mt': type === 0,
        })}
      >
        <h3>{title}</h3>
        {type !== 0 && (
          <div className='article-imgs'>
            {images.map((item, i) => (
              <div className='article-img-wrapper' key={i}>
                <Image src={item} alt='' />
              </div>
            ))}
          </div>
        )}
      </div>
      <div className={classNames('article-info', type === 0 ? 'none-mt' : '')}>
        <span>{article.aut_name}</span>
        <span>{article.comm_count} 评论</span>
        <span>{article.pubdate}</span>

        <span className='close'>
          <Icon type=''></Icon>
        </span>
      </div>
    </div>
  )
}
export default ArticleItem
